package com.eascs.p2p.conf;

import javax.servlet.Filter;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration.Dynamic;

import com.eascs.web.AbstractApplicationInitializer;

public class ApplicationInitializer extends AbstractApplicationInitializer {
	@Override
	protected Class<?>[] getRootConfigClasses() {
		return new Class[] { AppConfig.class };
	}

	@Override
	protected Class<?>[] getServletConfigClasses() {
		return new Class[] { WebConfig.class };
	}

	@Override
	protected String[] getServletMappings() {
		return new String[] { "/" };
	}

	@Override
	protected Filter[] getServletFilters() {
		return super.getServletFilters();
	}

	@Override
	public void onStartup(ServletContext servletContext) throws ServletException {
		super.onStartup(servletContext);
		//addSso(servletContext);
	}

//	private void addSso(ServletContext servletContext) {
//		servletContext.addListener(SingleSignOutHttpSessionListener.class);
//
//		this.registerServletFilter(servletContext, new SingleSignOutFilter());
//		this.registerServletFilter(servletContext, new EAAuthenticationFilter());
//		this.registerServletFilter(servletContext, new Cas20ProxyReceivingTicketValidationFilter());
//		this.registerServletFilter(servletContext, new HttpServletRequestWrapperFilter());
//		this.registerServletFilter(servletContext, new AssertionThreadLocalFilter());
//	}

	@Override
	protected void customizeRegistration(Dynamic registration) {
		super.customizeRegistration(registration);
	}

	@Override
	protected javax.servlet.FilterRegistration.Dynamic registerServletFilter(ServletContext servletContext, Filter filter) {
		return super.registerServletFilter(servletContext, filter);
	}
}
